﻿using DAL.Permission;
using Model.Permission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.Permission
{
    public class ModuleTypeBLL
    {
        ModuleTypeDAL dal = new ModuleTypeDAL();
        /// <summary>
        /// 排序
        /// </summary>
        /// <param name="order"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateOrder(int order, int id)
        {
            return dal.UpdateOrder(order, id);
        }

        /// <summary>
        /// 得到当前最大顺序
        /// </summary>
        public int GetCurrentOrder()
        {
            return dal.GetCurrentOrder();
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int ModuleTypeID, string ModuleName)
        {
            return dal.Exists(ModuleTypeID, ModuleName);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string ModuleName)
        {
            return dal.Exists(ModuleName);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ModuleTypeEntity model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ModuleTypeEntity model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int ModuleTypeID)
        {

            return dal.Delete(ModuleTypeID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string ModuleTypeIDlist)
        {
            return dal.DeleteList(ModuleTypeIDlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModuleTypeEntity GetModel(int ModuleTypeID)
        {

            return dal.GetModel(ModuleTypeID);
        }

    }
}
